package com.example.big_job.DB;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

public class DBHelper extends SQLiteOpenHelper {
    static String name="hjx.db";
    static int dbVersion=1;


    public DBHelper(Context context, int i) {
        super(context, name, null, dbVersion);
    }




    //建表
    @Override
    public void onCreate(SQLiteDatabase db) {
        String sql = "create table user(id integer primary key autoincrement," +
                "userName varchar unique,passWord varchar)";
        db.execSQL(sql);
        String sql2="create table food(id integer primary key autoincrement," +
                "foodName varchar,storeName varchar,tableName varchar,prize varchar)";
        db.execSQL(sql2);
    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {

    }
}

